<include file="public+header" />

{script}
var TEMP_PUBLIC = '__TMPLPUB__';

var apps = new Array();
var run = 0;
function testlink() {

	if(apps[run]) {

		Dyhb.Dom.$('status_' + apps[run]).innerHTML = D.L( '正在连接...' );
		Dyhb.Dom.$('link_' + apps[run]).src = Dyhb.Dom.GetAttr('link_'+apps[run],'testlink') + '?sid={$sid}';	
	}
	run++;
}

Dyhb.Dom.Ready(function(){
   testlink();
 });

{/script}


   <!-- 标题  -->
   <div class="title"><lang>应用列表</lang></div>

   <div class="note">
	<p class="i"><lang>如果出现\"通信失败\"，请点击\"编辑\"尝试设置应用域名对应的 IP。</lang></p>
   </div>

   <!-- 工具条  -->
   <div class="toolbar">
      <!--  功能操作区域  -->
      <div class="operate left" >
	      <input type="button" name="add" value="<lang>新增</lang>" onclick="add()" class="add button">
          <input type="button" name="edit" value="<lang>编辑</lang>" onclick="edit()" class="edit button">
          <input type="button" name="delete" value="<lang>删除</lang>" onclick="foreverdel()" class="delete button">
      </div>
      <!-- 查询区域 -->
      <div class="right search_form">
         <form method='post' action="__ACTION__">
            <div class="left">
			   <input type="text" name="application_name" title="<lang>应用名</lang>" class="field" >
               <input type="submit" id="" name="search" value="<lang>查询</lang>" onclick="" class="search button">
			</div>
        </form>
     </div>
  </div>

  <!-- 清除浮动 -->
  <span class="clear"></span>

  <!-- 正文 -->
  <div id="content" class="content">

      <table class="data full" id="checkList">
        <thead>
         <tr>
          <th width="5px"><input type="checkbox" onclick="checkAll('checkList')"></th>
          <th><a href="javascript:sortBy('application_id','{$sSortByUrl}')" title="<lang>按照编号</lang>{$sSortByDescription}<lang>排列</lang> "><lang>编号</lang></a></th>
          <th><a href="javascript:sortBy('application_name','{$sSortByUrl}')" title="<lang>按照应用名称</lang>{$sSortByDescription}<lang>排列</lang> "><lang>应用名称</lang></a></th>
          <th><a href="javascript:sortBy('application_url','{$sSortByUrl}')" title="<lang>按照应用的</lang> URL{$sSortByDescription}<lang>排列</lang> "><lang>应用的 URL</lang></a></th>
          <th><lang>通信情况</lang></th>
          <th><lang>操作</lang></th>
          </tr>
          </thead>
          <tbody>
          <foreach for=arrList>
		  <tr>
			<td><input type="checkbox" name="key" value="{$value['application_id']}" class="field" /></td>
			<td>{$value['application_id']}</td>
			<td><a href="javascript:edit('{$value['application_id']}')">{$value['application_name']}</a></td>
            <td><a href="{$value['application_url']}">{$value['application_url']}</a></td>
		    <td><div id="status_{$value['application_id']}"></div>
			<script id="link_{$value['application_id']}" testlink="{:G::U( 'application/ping',array(
			
			   'url'=>str_replace( '/','@',E::authcode( urlencode( $value['application_url'] ),'ENCODE' ) ),
			   'ip' =>$value['application_ip'].'*',
			   'id' =>$value['application_id'],
			   'random' =>rand(),
			))}"></script> 
			{script}apps[{$key}] = '{$value['application_id']}';{/script}
			</td>
			<td>{if $value['application_status']==1}<a href="javascript:forbid('{$value['application_id']}')"><lang>禁用</lang></a>{d*else}<a href="javascript:resume('{$value['application_id']}')"><lang>恢复</lang></a>{/if}&nbsp;<a href="javascript:edit('{$value['application_id']}')"><lang>编辑</lang></a>&nbsp;</td>
		  </tr>
          </foreach>
        </tbody>
        </table>

		<!-- 工具条  -->
		<div class="toolbar">
		   <!--  功能操作区域  -->
           <div class="operate" >
              <input type="button" name="add" value="<lang>新增</lang>" onclick="add()" class="add button">
              <input type="button" name="edit" value="<lang>编辑</lang>" onclick="edit()" class="edit button">
              <input type="button" name="delete" value="<lang>删除</lang>" onclick="foreverdel()" class="delete button">
           </div>
	    </div>

		<!-- 分页条  -->
		{$sPageNavbar}

   </div>
   <!-- end content -->

<include file="public+footer">